package Model;
import java.util.HashMap;
import java.util.ArrayList;
/**
 * Write a description of class Delordre here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Delordre
{
    // instance variables - replace the example below with your own
    private int antalVare;
    private Vare vare;
    private int delordreNr;
    private VareContainer vc;
    /**
     * Constructor for the class
     */
    public Delordre(int antal, int vare, int nr)
    {
        vc = VareContainer.getInstance();
        this.antalVare = antal;
        this.vare = vc.findVare(vare);
        this.delordreNr = nr;
    }

    /**
     * this mehod returns delordreNr
     * 
     * @param nothing
     * @return delordreNr
     */
    public int getDelOrdreNr()
    {
        return delordreNr;
    }

    /**
     * this mehod returns vare
     * 
     * @param nothing
     * @return vare
     */
    public Vare getVare()
    {
        return vare;
    }

    /**
     * this mehod returns myFaktura which holds information about a delordr
     * 
     * @param nothing
     * @return rs
     */
    public String myFaktura()
    {
        String rs = "";
        rs = antalVare + " " + vare.getVareBeskrivelse() + " " + calcTotalPris();
        return rs;
    }

    /**
     * this method returns calculate the total pris of delordre
     * 
     * @param nothing
     * @return totalpris
     */
    public double calcTotalPris()
    {
        double totalpris;
        totalpris = antalVare*vare.getSalgspris();
        return totalpris;
    }

}
